package com.sky.mapper;

import com.sky.connotation.AutoFill;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author yisen
 * @Date 2024/3/7 16:14
 * @PackageName:com.sky.mapper
 * @ClassName: SetmealDishMapper
 * @Description:
 * @Version 1.0
 */
@Mapper
public interface SetmealDishMapper {
    //判断当前要删除的菜品是否被套餐关联了
    List<Long> getSetmealIdsByDishIds(List<Long> ids);
    //保存套餐和菜品的关联关系
    void insertBatch(List<SetmealDish> setmealDishes);
    //删除套餐菜品关系表中的数据
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);

}
